package com.java.dormitorymanager.service.impl;

import com.java.dormitorymanager.dao.IDormDao;
import com.java.dormitorymanager.impl.DormDaoImpl;
import com.java.dormitorymanager.pojo.Dorm;
import com.java.dormitorymanager.pojo.Student;
import com.java.dormitorymanager.service.IDormService;

import java.util.List;

/**
 * @program: DormitoryManager
 * @description: IDormService的实现类
 * @author: ShuangChenYue
 * @create: 2021-05-17 14:43
 **/
public class DormServiceImpl implements IDormService
{
    IDormDao dormDao = new DormDaoImpl();

    @Override
    public List<Dorm> findAllManDorm()
    {
        return dormDao.findAllManDorm();
    }

    @Override
    public List<Dorm> findAllWomanDorm()
    {
        return dormDao.findAllWomanDorm();
    }

    @Override
    public void addDorm(Dorm dorm)
    {
        dormDao.addDorm(dorm);
    }

    @Override
    public void addMaleStudentToDorm(String dormNumber,int id)
    {
        dormDao.addMaleStudentToDorm(dormNumber,id);
    }

    @Override
    public void addAmount(int amount,String dormNumber)
    {
        dormDao.addAmount(amount,dormNumber);
    }

    @Override
    public List<Student> findAllMSByDormNumber(String dormNumber)
    {
        return dormDao.findAllMSByDormNumber(dormNumber);
    }

    @Override
    public List<Student> findAllStudentsByDornum(String dornum)
    {
        return dormDao.findAllStudentsByDornum(dornum);
    }

    @Override
    public void deleteStudentFromDormById(int id)
    {
        dormDao.deleteStudentFromDormById(id);
    }

    @Override
    public void updateScoreByDornum(String dornum, int score)
    {
        dormDao.updateScoreByDornum(dornum,score);
    }

    @Override
    public void deleteDormByDornum(String dornum)
    {
        dormDao.deleteDormByDornum(dornum);
    }

    @Override
    public void updateDormInfoById(int id, String dornum)
    {
        dormDao.updateDormInfoById(id,dornum);
    }

    @Override
    public void updateStudentDornumByMetaDornum(String dornum, String metaDornum)
    {
        dormDao.updateStudentDornumByMetaDornum(dornum,metaDornum);
    }

    @Override
    public List<Dorm> showAllManDormUpWithScore()
    {
        return dormDao.showAllManDormUpWithScore();
    }

    @Override
    public List<Dorm> showAllManDormDownWithScore()
    {
        return dormDao.showAllManDormDownWithScore();
    }

    @Override
    public void addFemaleStudentToDorm(String dormNumber, int id)
    {
        dormDao.addFemaleStudentToDorm(dormNumber,id);
    }

    @Override
    public List<Dorm> showAllWomanDormUpWithScore()
    {
        return dormDao.showAllWomanDormUpWithScore();
    }

    @Override
    public List<Dorm> showAllWomanDormDownWithScore()
    {
        return dormDao.showAllWomanDormDownWithScore();
    }

    @Override
    public Dorm findDormByDornum(String dornum)
    {
        return dormDao.findDormByDornum(dornum);
    }
}
